{# The Models table, rendered on the page and pushed again by its stream. A button answers at once (``data-api-done``); the row shows the rest. #} {% from "components/macros/layout.html" import card %} {% from "components/macros/table.html" import data_table %} {% from "components/macros/form.html" import action %} {% macro row_actions(row) -%} {% if row.moving %} {% elif row.loaded %} {{ action("Unload", 'hx-post="' ~ partials ~ '/unload" hx-swap="none" hx-disabled-elt="this" data-api-done="Unloading"', "warn", vals={"model": row.model}) }} {% else %} {{ action("Load", 'hx-post="' ~ partials ~ '/load" hx-swap="none" hx-disabled-elt="this" data-api-done="Loading"', "primary", vals={"model": row.model}) }} {% endif %} {%- endmacro %}